package nl.javasteam.dotcomgame;

import java.util.List;

public class DotCom {

	private List<String> locationCells;
	private String name;
		
	public void setLocationCells(List<String> loc){
		locationCells = loc;
	}
	
	public void setName(String n){
		name = n;
	}
	
	public String checkYourSelf(String userInput){
		String result = "miss";
		int index = locationCells.indexOf(userInput);
		if(index >= 0){
			locationCells.remove(index);
			if(locationCells.isEmpty()){
				result = "kill";
				System.out.println("Ouch, You sunk " + name + ".");
			} else {
				result = "hit";
			}
		}
		return result;
	}
}
